#include <stdio.h>
#include <stdlib.h>

#include "lgwseq.h"
#include "str_id.h"
#include "types.h"

extern struct list_head str_id_head;
extern unsigned int str_id_list_size;

void str_id_test() {
	lgwseq_t *lws = for_lgwseq(3, L"BIT");
	
	struct str_id_st str_id = add_str_id(lws);
	
	if(str_id->str_dt->unpacked_data == lws)
		printf("str_id (unpacked_data) OK\n");
	else {
		fprintf(stderr, "str_id (unpacked_data) NOK\n");
		exit(-1);
	}
		
	if(str_id_list_size==1)
		printf("str_id_list_size OK\n");
	else {
		fprintf(stderr, "str_id_list_size NOK\n");
		exit(-1);
	}
	
	struct str_id_st bit = list_peek_entry(struct str_id_st, str_id_list, str_id_head);
	
	if(str_id==bit)
		printf("str_id_head OK\n");
	else {
		fprintf(stderr, "str_id_head NOK\n
		exit(-1);
	}
}